package com.wkbb.basic.thread;

import com.wkbb.basic.service.UserOpenService;
import lombok.extern.slf4j.Slf4j;

/**
 * @author dengjingyuan
 * @date 2019-11-16 18:11
 */
@Slf4j
public class ImDeleteRedisAddressBookKeyTask implements Runnable  {

    private Long userId;

    private Integer roleType;

    private Long orgId;

    private UserOpenService userOpenService;

    public ImDeleteRedisAddressBookKeyTask(Long userId, Integer roleType, Long orgId, UserOpenService userOpenService) {
        this.orgId = orgId;
        this.userId = userId;
        this.roleType = roleType;
        this.userOpenService = userOpenService;
    }

    public ImDeleteRedisAddressBookKeyTask() {

    }

    @Override
    public void run() {
        log.info("*********ImDeleteRedisAddressBookKeyTask********userId:{},roleType:{},orgId:{},,userOpenService:{}", userId,roleType,orgId,userOpenService);
        try {

            userOpenService.deleteRedisAddressBookKey(userId,roleType, orgId);
        } catch (Exception e) {
            log.error("*******ImDeleteRedisAddressBookKeyTask**********", e);
        }
    }
}
